﻿using Lhz.Data;
using Lhz.Sc.Business;
using Lhz.Sc.Entity.Database;
using Lhz.Test.Common;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;

namespace Lhz.Sc.Test.LhzScBusiness
{
    [TestClass]
    public class UnitTestApplication
    {
        private ApplicationProxy ap = new ApplicationProxy();

        [TestMethod]
        public void ApplicationProxyTestMethodCommon()
        {
            var application = TestEntityBuilder.BuildApplication();
            var dbt = new ProxyCrudTester<Guid, Application>();
            var changes = new Dictionary<string, object>();
            changes.Add("Name", "Name");
            changes.Add("Description", "Description");
            dbt.CrudTest(application, application.Guid, changes);
        }

        [TestMethod]
        public void ApplicationProxyTestMethodQueryByPagination()
        {
            var pagination = new Pagination() { Index = 1, Size = 10 };
            var applications = ap.Query(pagination);
            Assert.IsTrue(pagination.Count == applications.Count);
        }
    }
}
